package com.augurit.common.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 用户岗位关联Entity类
 * 
 */
@Entity
@Table(name = "OM_USER_POSITION")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class OmUserPosition {

	//属性
	private Long upId;		//主键ID
	private Long userId;	//用户ID
	private Long posId;		//机构ID
	private String isMain;	//是否主岗位。0为非主岗位，1为主岗位

	
	@Id
    @SequenceGenerator(name="SEQ_OM_USER_POSITION", sequenceName="SEQ_OM_USER_POSITION", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_OM_USER_POSITION")
	public Long getUpId() {
		return upId;
	}

	public void setUpId(Long upId) {
		this.upId = upId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getPosId() {
		return posId;
	}

	public void setPosId(Long posId) {
		this.posId = posId;
	}

	public String getIsMain() {
		return isMain;
	}

	public void setIsMain(String isMain) {
		this.isMain = isMain;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}